//
// Created by lxinp on 2022/8/29.
//

#ifndef DATASTRUCTURE_LFU_CACHE_H
#define DATASTRUCTURE_LFU_CACHE_H

#include <unordered_map>
#include <set>

using namespace std;


class LFUCache {
private:
    struct Node {
        int key, val;
        int cnt, time;
        Node(int _cnt, int _time, int _key, int _val) : cnt(_cnt), time(_time), key(_key), val(_val) {}

        bool operator<(const Node& rhs) {
            return cnt == rhs.cnt ? time < rhs.time : cnt < rhs.cnt;
        }
    };

    int size, capacity;
    unordered_map<int, int> cache;
    set<Node> s;

public:
    LFUCache(int _capacity) {
        capacity = _capacity;

    }


private:

};


#endif //DATASTRUCTURE_LFU_CACHE_H
